import Vue from 'vue'
import { setDetail, getDetail, removeDetail, getTimeStr, getThousandNum, formatMoneyStr, getNumFormat, keepTwoDecimalFull } from '@/utils/auth'
import { picPath, regionList, orderStateList, adminV, agencyV, dealerMV, dealerV, checkPageUpdate } from '@/control'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import locale from 'element-ui/lib/locale/lang/en'
import ElementUI from 'element-ui'
// import ElementUI from './elementpart.js'
import 'element-ui/lib/theme-chalk/index.css'
import { Message } from 'element-ui'
Vue.prototype.$message = Message
Vue.use(ElementUI, { locale })
// Vue.use(ElementUI)// 中文版elementUI
import Breadcrumb from '@/components/Breadcrumb'

// import echarts from 'echarts'
let echarts = require('echarts/lib/echarts')
require('echarts/lib/chart/line') // 线型图
require('echarts/lib/component/dataZoom')// dataZoom组件
require('echarts/lib/component/tooltip')// tooltip
require('echarts/lib/component/title')// 图表标题

import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
checkPageUpdate()
Vue.prototype.$echarts = echarts
Vue.prototype.$setDetail = setDetail
Vue.prototype.$getDetail = getDetail
Vue.prototype.$removeDetail = removeDetail
const now = new Date()
import Print from '@/utils/exportToPrint' // 引入附件的js文件
Vue.use(Print) // 注册
Vue.prototype.$now = now
Vue.prototype.$regionList = regionList// 州列表
Vue.prototype.$orderStateList = orderStateList// 订单状态列表
Vue.prototype.$getTime = getTimeStr// 时间格式化
Vue.prototype.$getThouNum = getThousandNum// 千分位
Vue.prototype.$keepTwoDecimalFull = keepTwoDecimalFull// 保留两位
Vue.prototype.$formatMoneyStr = formatMoneyStr// 格式化金额数字
Vue.prototype.$getNumFormat = getNumFormat
Vue.prototype.picbase = picPath
Vue.prototype.adminValue = adminV
Vue.prototype.agencyValue = agencyV
Vue.prototype.dealerMValue = dealerMV
Vue.prototype.dealerValue = dealerV
Vue.component('Pathnavigation', Breadcrumb)
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
